package com.zsh.rabbitmq.utils;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

/**
 * @author zsh
 * @Description 链接工厂通道的工具类
 * @create 2022-04-26 13:59
 */
public class RabbitMQUtils {
    public static Channel getChannel() throws Exception{
        //创建链接工厂
        ConnectionFactory factory = new ConnectionFactory();
        factory.setHost("192.168.200.128");
        factory.setUsername("admin");
        factory.setPassword("123456");

        Connection connection = factory.newConnection();
        return connection.createChannel();
    }
}
